<template>
  <div class="total_all_info">
    <div class="top-side">
      <div class="left-side isolateTotal">
        <!-- 隔离点总数 -->
        <div class="num">
          <img :src="isolateTotal.icon" alt="" />
          <span>{{ isolateCollectVo[isolateTotal.key] }}</span>
        </div>
        <p class="name">{{ isolateTotal.label }}</p>
      </div>
      <div class="right-side">
        <!-- 隔离点人员房间 -->
        <div class="isolateHouseTotal">
          <div class="num">
            <img :src="isolateHouseTotal.icon" alt="" />
            <span>{{ isolateCollectVo[isolateHouseTotal.key] }}</span>
          </div>
          <p class="name">{{ isolateHouseTotal.label }}</p>
        </div>
        <!-- 工作人员房间 -->
        <div class="workPersonHouseTotal">
          <div class="num">
            <img :src="workPersonHouseTotal.icon" alt="" />
            <span>{{ isolateCollectVo[workPersonHouseTotal.key] }}</span>
          </div>
          <p class="name">{{ workPersonHouseTotal.label }}</p>
        </div>
      </div>
    </div>
    <!-- 各类房间情况 -->

    <div class="rooms">
      <div
        v-for="(infoItem, index) in infoArr"
        :key="index"
        class="num-panel"
        :style="infoItem.styles"
      >
        <div class="num-wrap">
          <img :src="infoItem.icon" />
          <div class="num">
            <span class="value">{{ isolateCollectVo[infoItem.key] }}</span>
            <span class="unit">{{ infoItem.unit }}</span>
          </div>
        </div>
        <div class="name">{{ infoItem.label }}</div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "totalAllInfo",
  props: {
    isolateCollectVo: {
      type: Object
    }
  },
  data () {
    return {
      isolateTotal: {
        icon: require('../images/top-icon.png'),
        defaultIcon: true,
        key: 'isolateTotal',
        label: '隔离点总数',
        unit: '个',
      },
      isolateHouseTotal: {
        icon: require('../images/top-icon2.png'),
        defaultIcon: true,
        key: 'isolateHouseTotal',
        label: '隔离人员房间',
        unit: '间',
      },
      workPersonHouseTotal: {
        icon: require('../images/top-icon2.png'),
        defaultIcon: true,
        key: 'workPersonHouseTotal',
        label: '工作人员房间',
        unit: '间',
      },
      infoArr: [
        {
          icon: require('../images/fangjian-ruzhu.svg'),
          defaultIcon: false,
          key: 'moveTotal',
          label: '入住房间',
          unit: '',
        },
        {
          icon: require('../images/fangjian-kong.svg'),
          defaultIcon: false,
          key: 'leaveTotal',
          label: '空房间',
          unit: '',
        },
        {
          icon: require('../images/xiaodu.png'),
          key: 'waitKillTotal',
          label: '待消杀',
          unit: '',
        },
        {
          icon: require('../images/suoding.png'),
          key: 'lockTotal',
          label: '锁定',
          unit: '',
        }
      ]
    }
  }
}
</script>

<style lang="scss" scoped>
.total_all_info {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 3px 0;
  // align-items: center;
  // &>div{
  //   // flex: 1;
  // }
  .top-side{
    display: flex;
    color: #fff;
    text-align: center;
    margin-left: -7px;
    margin-right: -7px;
    img{
      width: 22px;
      height: 22px;
    }
    .num{
      font-size: 24px;
      display: flex;
      align-items: center;
      justify-content: center;
      img{
        margin-right: 7px;
      }
    }
    .name{
      font-size: 13px;
      line-height: 32px;
    }
    .right-side{
      display: flex;
      flex-direction: column;
      margin-left: -9px;
      flex: 1;
    }
    .isolateTotal{
      width: 146px;
      height: 137px;
      background: url('../images/total-bg.png') no-repeat;
      background-size: 100% 100%;
      padding: 30px;
    }
    .isolateHouseTotal{
      height: 73px;
      background: url('../images/man-bg.png') no-repeat;
      background-size: 100% 100%;
      padding: 12px;
      .name{
        line-height: 19px;
      }
    }
    .workPersonHouseTotal{
      height: 73px;
      background: url('../images/workman-bg.png') no-repeat;
      background-size: 100% 100%;
      margin-top: -10px;
      padding: 12px;
      .name{
        line-height: 19px;
      }
    }
  }
  .rooms{
    display: flex;
    text-align: center;
    .num-panel{
      text-align: center;
      flex:1;
      padding: 8px 6px;
      // width: 86px;
      height: 58px;
      color: #2881E2;
      background: linear-gradient(270deg, #DCEEFF 0%, #BEE0FF 100%);
      display: flex;
      flex-direction: column;
      &:first-child{
        border-radius: 4px 0px 0px 4px;
      }
      &:last-child{
        border-radius: 0px 4px 4px 0px;
      }
      .num-wrap{
        display: flex;
        justify-content: center;
        align-items: center;
        img {
          margin-right: 4px;
        }
        .num{
          font-size: 18px;
        }
      }
      img{
        width: 15px;
        height: 16px;
      }
    }
    
    .name{
      font-size: 13px;
    }
  }
}
</style>
